
{% extends "layout.html" %}

{% block content %}
    <style type="text/css">
        a:link, a:visited, a:active { color: #000; text-decoration: none; }
        a:hover { color: #234b6a;text-decoration:underline; }
        
        
        
        #left { float: left; width: 400px; }
        #middle { float: left; width: 300px; margin-left: 10px; }
        #right { float: left; width: 280px; margin-left: 10px; }
        
        td.title { padding-left:9px; color: #ffffff; text-align: left;  }
        td.more {padding-right:9px; color: #007AFF; text-align: right; }
        
        /* 公司简介 */
        #intro { width: 400px; margin-top: 10px; }
        #intro_title { width: 400px; height: 40px; background: url(/static/Images/intro_title.png) no-repeat; }
        #intro_title table { width: 400px;height: 30px;  font-size: 14px; }
        #intro_content { height:99px; font: 12px/22px '微软雅黑'; padding: 8px; padding-top: 2px; border: 1px solid #cfcfcf; border-top: 0; }

        /* 最新新闻 */
        #news { width: 300px; }
        #news_title { width: 300px; height: 40px; background: url(/static/Images/news_title.png) no-repeat; }
        #news_title table { width: 300px;height: 30px;  font-size: 14px; }
        #news_content { font-size: 14px; height: 419px; border: 1px solid #cfcfcf; border-top: 0; }
        #news_content ul { padding-left: 30px; }
        #news_content ul li span { float: right; padding-right: 10px; }
        /* 成功案例 */
        #success { width: 280px; }
        #success_title { width: 280px; height: 40px; background: url(/static/Images/success_title.png) no-repeat; }
        #success_title table { width: 280px;height: 30px;  font-size: 14px; }
        #success_content { height: 419px; border: 1px solid #cfcfcf; border-top: 0;padding: 3px 5px; }
    </style>
    <script src="static/Scripts/jquery.KinSlideshow-1.2.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
           
            var ajaxUrl = "admin/ajax";
            // 新闻列表
            $.ajax({
            url:ajaxUrl,
            data:{typ:'1'},
            dataType:'json',
            }).done(function(data){
            for(var i=0;i<data.length;i++){
                var stit=data[i].tit;
                if(stit.length>17){
                    stit=stit.substring(0,17)+'...';
                }
                $('#news_content ul').append($('<li><a href="/detail/'+ data[i].id + '" title="'+data[i].tit+'">'+stit+
                '</a></li>'));
            }
            });

            // 图片新闻
            $.ajax({
            url:ajaxUrl,
            data:{typ:'2'},
            dataType:'json',
            }).done(function(data){            
            for(var i=0;i<data.length;i++){
                var stit=data[i].tit;
                if(stit.length>20){
                    stit=stit.substring(0,20)+'...';
                }
                $('#KinSlideshow').append($('<a href="#" target="_blank"><img src="'+data[i].imgpth+
                '" alt="'+stit+'" width="400" height="300" /></a>'));
            }
             $("#KinSlideshow").KinSlideshow({
                moveStyle: "left",
                titleBar: { titleBar_height: 30, titleBar_bgColor: "#08355c", titleBar_alpha: 0.5 },
                titleFont: { TitleFont_size: 12, TitleFont_color: "#FFFFFF", TitleFont_weight: "normal" },
                btn: { btn_bgColor: "#FFFFFF", btn_bgHoverColor: "#1072aa", btn_fontColor: "#000000", btn_fontHoverColor: "#FFFFFF", btn_borderColor: "#cccccc", btn_borderHoverColor: "#1188c0", btn_borderWidth: 1 }
            });
            });

            // 成功案例
            $.ajax({
            url:ajaxUrl,
            data:{typ:'3'},
            dataType:'json',
            }).done(function(data){
              
                    for(var i=0;i<data.length;i++){
                    var stit1=data[i].tit;
                    if(stit1.length>13){
                        stit1=stit1.substring(0,13)+'...';
                    }
                    var trhtm='<tr><td><img src="'+data[i].imgpth+'" /><span>'+stit1+'</span></td><td>';

                    i++;

                    if(data[i]){
                         var stit2=data[i].tit;
                        if(stit2.length>13){
                        stit2=stit2.substring(0,13)+'...';
                        }
                        trhtm+='<img src="'+data[i].imgpth+'" /><span>'+stit2+'</span>';
                    }
                    trhtm+='</td></tr>';
                    $('#success_content table').append($(trhtm)); 
               }
            
            });

            //公司简介
            $.ajax({
            url:ajaxUrl,
            data:{typ:'4'},
            dataType:'html',
            }).done(function(data){
              
                    $('#intro_content').html(data); 
               });

    });
        
    </script>
    <div id="left">
        <div id="KinSlideshow" style="visibility: hidden;">
        </div>
        <div id="intro">
            <div id="intro_title">
            <table><tr><td class="title">学院概况</td><td class="more"><a href='DNTWBX0004.html'>更多>></a></td></tr></table>
            </div>
            <div id="intro_content">
               
            </div>
        </div>
    </div>
    <div id="middle">
        <div id="news">
            <div id="news_title">
                <table><tr><td class="title">新闻动态</td><td class="more"><a href='/news'>更多>></a></td></tr></table>
            </div>
            <div id="news_content">
                <ul>
                </ul>
            </div>
        </div>
    </div>
    <div id="right">
        <div id="success">
            <div id="success_title">
            <table><tr><td class="title">产学研</td><td class="more"><a href='DNTWBX0008.html'>更多>></a></td></tr></table>
            </div>
            <div id="success_content">
                
            </div>
        </div>
    </div>
    <div style="clear: both;">
    </div>
{% endblock %}
